Collection and Drop Off API

(0 reviews)

Drop Off Addresses

Resource URL

UAT:

https://api.uat.nzpost.co.nz/collectionaddress/v1/dropoffs/all
https://api.uat.nzpost.co.nz/collectionaddress/v1/dropoffs/{address_id}

Production:

https://api.nzpost.co.nz/collectionaddress/v1/dropoffs/all
https://api.nzpost.co.nz/collectionaddress/v1/dropoffs/{address_id}

Resource Information

AttributeDetail
Response FormatJSON
Requires AuthenticationYes
Rate Limited15 calls per second. If rate limit is exceeded, calls will be queued. Calls unprocessed for over 60 seconds will time out.

Resource Description

1. The all drop off resource has no parameters required to retrieve a list of all of the drop off points.

2. Another drop off resource uses an address_id and param of count & max_distance to retrieve address details for the address_id and a list of nearby drop off points. The address_Id can be obtained using the "Search for Address" resource in the ParcelAddress API. Notes: Please make “ParcelAddress” a link to the ParcelAddress 2.0 page in the developer portal.

Please note that all request parameters should be in lower case.

Request Parameters

The resource of the "all drop off addresses" has no parameters required.

The following list of the request parameters for the "drop off parcel addresses" resource.

Field NameDescriptionMandatoryExample
address_idNZ Post address identifier as URI parameterYes12345
countNumber of parcel drop off location address records to be returned(min:1,default:10)No12
max_distanceLocations returned are within the max distance radius, measured in kilometres. (default:5)No10

Sample Request

https://api.nzpost.co.nz/collectionaddress/v1/dropoffs/all
https://api.nzpost.co.nz/collectionaddress/v1/dropoffs/12345?count=3&max_distance=10

Response Parameters

All Drop Off Address Object

The following lists the required fields in the Get all Drop Off Address Detail response message:

Field NameDescriptionMandatoryExample
successReturns if request is successfulYesTrue
drop_off_locationsAddress object with address detailsY if success = trueJSON Object
message_idThe envent message markYesa2d13150-5f38-11ee-b010-02d78cbdb7cdthe

Drop Off Object

Field NameDescriptionMandatoryExample
company_nameName of the company hosting the collection pointYesDunedin CourierPost Depot
latLongitude of the collection PointYes-45.888675
lngLongitude of the collection PointYes170.503033
phoneContact phone number for the collection pointYes0800 268 7437
full_addressHuman readable street address for the collection pointYesStrathallan Street, South Dunedin, Dunedin 9012
idLocation ID for the drop off pointYes99054
hoursArray listing the opening and closing hours of the collection point for each day of the weekYesJSON Object
address_detailsThe drop off location detailsYesJSON Object
servicesThe drop off location's service scopeYes["post_a_parcel","pay_a_bill","send_a_letter"]
typeService type of the drop off locationYesPostShop

Hours Array

The following lists the field in the hours object.

Field NameDescriptionMandatoryExample
dayIndicates the day of the week where 0 = Sunday through 6 = SaturdayYes2
openTime of opening for day indicated in day parameter using 24 hour clockNo08:30
closeTime of closing for day indicated in day parameter using 24 hour clock. If location not open, then parameter set to 'true'Yes18:00

Address_details Object

The following lists the field in the address_details object.

Field NameDescriptionMandatoryExample
address_line_1Details of the street number and building nameYes5 Strathallan Street
suburbThe name of the suburb the address residesYesSouth Dunedin
cityThe city the address resides inYesDunedin
post_codeThe postcode associated with the addressYes9012

Drop Off Search Object

The following lists the required fields in the Get the Nearby Drop Off Address Detail response message:

Field NameDescriptionMandatoryExample
successReturns if the request is successfulYesTrue
addressAddress object with address detailsY if success = trueJSON Object
message_idThe envent message markYesa2d13150-5f38-11ee-b010-02d78cbdb7cd

Address Object

Field NameDescriptionMandatoryExample
street_numberThe street number of the addressYes71
streetThe name of the streetYesOregon
street_typeType of the streetYesStreet
suburbThe name of the suburb the address resides inYesOcean Grove
cityThe name of the city the address resides inYesDunedin
is_rural_deliveryDetermines if this is a rural or an urban address (true for rural)Yesfalse
postcodeThe postcode associated with the addressYes9013
longitudeThe GPS longitude coordinate if the data existsYes170.552
latitudeThe GPS latitude coordinate if the data existsYes-45.9041
run_numberThe run number that indicates which courier run will service this addressYesDCP025
depot_nameThe name of the depot that services this addressYesDunedin Depot
countryThe name of the country the address residesYesNew Zealand
dpidDelivery point identifierYes54218
address_idLocation ID for the drop off pointYes12345
drop_off_locationsContains array of post the parcel location objects. The number of objects will not exceed the ‘count’ value defined and the max distance will not exceed the ‘max_distance’ value defined.Yes if success=trueJSON Object

Drop_off_locations Object

The following lists the fields in the locations object.

Field NameDescriptionMandatoryExample
company_nameName of the company hosting the collection pointYesDunedin CourierPost Depot
latLongitude of the collection PointYes-45.888675
lngLongitude of the collection PointYes170.503033
phoneContact phone number for the collection pointYes0800 268 7437
full_addressHuman readable street address for the collection pointYesStrathallan Street, South Dunedin, Dunedin 9012
idLocation ID for the drop off pointYes99054
hoursArray listing the opening and closing hours of the collection point for each day of the weekYesJSON Object
distance_in_mDistance between the address and drop off locationYes4159
address_detailsThe drop off location detailsYesJSON Object
servicesThe drop off location's service scopeYes["post_a_parcel","pay_a_bill","send_a_letter"]
typeService type of the drop off locationYesPostShop

Hours Array

The following lists the field in the hours object.

Field NameDescriptionMandatoryExample
dayIndicates the day of the week where 0 = Sunday through 6 = SaturdayYes2
openTime of opening for day indicated in day parameter using 24 hour clockNo08:30
closeTime of closing for day indicated in day parameter using 24 hour clock. If location not open, then parameter set to 'true'Yes18:00

Address_details Object

The following lists the field in the address_details object.

Field NameDescriptionMandatoryExample
address_line_1Details of the street number and building nameYes5 Strathallan Street
suburbThe name of the suburb the address residesYesSouth Dunedin
cityThe city the address resides inYesDunedin
post_codeThe postcode associated with the addressYes9012

Response Message - Collection and Drop Off API Response Message

Sample get all drop off request : https://api.nzpost.co.nz/collectionaddress/v1/dropoffs/all

Sample get all drop off success response:

  {
    "success": true,
    "drop_off_locations": [
        {
            "company_name": "NZ Post Shop Beachlands",
            "lat": -36.882536,
            "lng": 174.996944,
            "phone": "09 536 6118",
            "full_address": "Beachlands PostShop & Lotto, 38 Wakelin Road, Beachlands, Auckland 2018",
            "id": 58040,
            "hours": [
                {
                    "day": 0,
                    "open": "09:00",
                    "close": "17:00"
                },
                {
                    "day": 1,
                    "open": "09:00",
                    "close": "17:00"
                },
                {
                    "day": 2,
                    "open": "09:00",
                    "close": "17:00"
                },
                {
                    "day": 3,
                    "open": "09:00",
                    "close": "17:00"
                },
                {
                    "day": 4,
                    "open": "09:00",
                    "close": "17:00"
                },
                {
                    "day": 5,
                    "open": "09:00",
                    "close": "14:30"
                },
                {
                    "day": 6,
                    "closed": true
                }
            ],
            "address_details": {
                "address_line_1": "38 Wakelin Road",
                "suburb": "Beachlands",
                "city": "Auckland",
                "post_code": "2018"
            },
            "services": [
                "box_lobby",
                "post_a_parcel",
                "purchase_postage",
                "pay_a_bill",
                "counter_delivery",
                "post_a_letter_standard",
                "parcel_collection",
                "missed_parcel_collection_only",
                "send_a_parcel_in_nz",
                "send_a_parcel_overseas",
                "send_a_letter"
            ],
            "type": "PostShop"
        }, {...}, {...}
      ],
    "message_id": "a2d13150-5f38-11ee-b010-02d78cbdb7cd"
}

Sample get all drop off request : https://api.nzpost.co.nz/collectionaddress/v1/dropoffs/12345?count=3&max_distance=10

Sample drop off search success response:

  {
    "success": true,
    "address": {
        "street_number": 71,
        "street": "Oregon",
        "street_type": "Street",
        "suburb": "Ocean Grove",
        "city": "Dunedin",
        "is_rural_delivery": false,
        "gated_community_flag": false,
        "postcode": "9013",
        "longitude": 170.552,
        "latitude": -45.9041,
        "run_number": "DCP015",
        "depot_name": "Dunedin Depot",
        "country": "New Zealand",
        "dpid": 33837,
        "address_id": 12345,
        "drop_off_locations": [
            {
                "company_name": "NZ Post Dunedin Depot",
                "lat": -45.888675,
                "lng": 170.503033,
                "phone": "0800 268 7437",
                "full_address": "5 Strathallan Street, South Dunedin, Dunedin 9012",
                "id": 99054,
                "hours": [
                    {
                        "day": 0,
                        "open": "08:30",
                        "close": "18:00"
                    },
                    {
                        "day": 1,
                        "open": "08:30",
                        "close": "18:00"
                    },
                    {
                        "day": 2,
                        "open": "08:30",
                        "close": "18:00"
                    },
                    {
                        "day": 3,
                        "open": "08:30",
                        "close": "18:00"
                    },
                    {
                        "day": 4,
                        "open": "08:30",
                        "close": "18:00"
                    },
                    {
                        "day": 5,
                        "open": "09:00",
                        "close": "12:00"
                    },
                    {
                        "day": 6,
                        "closed": true
                    }
                ],
                "distance_in_m": 4159,
                "address_details": {
                    "address_line_1": "5 Strathallan Street",
                    "suburb": "South Dunedin",
                    "city": "Dunedin",
                    "post_code": "9012"
                },
                "services": [
                    "post_a_parcel",
                    "parcel_collection"
                ],
                "type": "Depot"
            }
            ]
    },
    "message_id": "019f04b0-5f38-11ee-b010-02d78cbdb7cd"
}

Response message- Collection and Drop Off API Error Response Message

Sample failure response:

 {
   "success": false,
   "errors": [ {
   "code": "40001",
   "message": "Bad Request",
   "details": "You may have entered invalid or missing input parameters,
   please consult the API documentation if in doubt." } ],
   "message_id": "4dd9d6d0-ab89-11e6-b31d-0692fd96189f"
 }

HTTP Status Codes

Note that some error messages are customized for the request, i.e. error code 400 usually will describe what is wrong with the request

CodeMessage
200Success
400Bad Request
401Unauthorized
403Forbidden
404Not Found
409Invalid request
500System unavailable

Error Codes

CodeMessage
200001Partial results returned,not all system(s) have responded
200002All sources responded,data may be incomplete
400001Parameter(s) missing
400002Invalid parameter(s)
400003Non mutually exclusive parameters detected
401001Unauthorized access, please contact administrator
500001General Exception
500002System(s) offline

Reviews